package com.ems.config;

import com.ems.filter.CorsFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.logging.Filter;

@Configuration
public class WebConfig {

    @Bean
    public FilterRegistrationBean filterRegistration(){
        FilterRegistrationBean registration = new FilterRegistrationBean((new CorsFilter()));
        registration.addUrlPatterns("/*");
        registration.setName("corsFilter");
        return registration;
    }

}
